package net.example.utils;

import android.os.Environment;

import net.example.manager.GGApplication;
import net.example.ggtalk.R;

import java.io.File;

public class ConfigUtils {
	public static String appSharePreferenceName = "ggtalk_sharepreference";
	public static String apkName = "ggtalk.apk";
	public static String SDRootPath = Environment.getExternalStorageDirectory().getAbsolutePath();
	public static String SDImageCachePath =  "/sdcard/ggtalk/img/"; // 图片缓存目录
	public static String SDFileSavePath = "/sdcard/ggtalk/file/"; // File目录
	public static String SDLogSavePath = "/sdcard/ggtalk/log/";
	public static String cameraimagepath = "cameratemp.jpg";
	public static String avatar = "avatar.jpg";
	public static String pickimagepath = "picktemp.jpg";
	public  static String TalkingType ="TALKINGTYPE";
	public  static  String Person_Talking="Person";
	public  static  String Group_Talking="Group";
	public  static  String Group_Talking_Name="Group_NAME";
	public static String esfServerIP= GGApplication.getInstance().getBaseContext().getString(R.string.host);//ESF服务器IP
	public static int esfServerPort=Integer.valueOf(GGApplication.getInstance().getBaseContext().getString(R.string.serverport));//ESF服务器Port
	public static int omcsServerPort=Integer.valueOf(GGApplication.getInstance().getBaseContext().getString(R.string.omcsport));//omcs服务器Port


	public static void initialize()
	{
		ensureDirectoryExist(SDImageCachePath);
		ensureDirectoryExist(SDFileSavePath);
		ensureDirectoryExist(SDLogSavePath);
	}

	public static void ensureDirectoryExist(String filePath)
	{
		String dir= com.oraycn.esbasic.helpers.FileHelper.getFileDirectory(filePath);
		File file=new File(dir);
		if(!file.exists())
		{
			file.mkdirs();
		}
	}

	/// <summary>
	/// 注册账号前缀
	/// </summary>
	public static String RegistActionToken = "#Reg:";

	/// <summary>
	/// 注册账号前缀
	/// </summary>
	public static String RegistActionToken2 = "#Reg2:";

	/// <summary>
	/// 获取注册验证码前缀
	/// </summary>
	public static String GetRegistCodeToken = "#GetRegCode:";

	/// <summary>
	/// 获取重置密码 验证码前缀
	/// </summary>
	public static String GetResetPasswordCodeToken = "#GetResetPasswordCode:";

	/// <summary>
	/// 重置密码 前缀
	/// </summary>
	public static String ResetPasswordActionToken = "#ResetPassword:";

	/**
	 * 冒号分隔符
	 * */
	public static final String ColonSeparator=":";
	/**
	 * 逗号分隔符
	 * */
	public static final String CommaSeparator=",";

	/**
	 * 群组前缀
	 * */
	public static final String GroupPrefix="*";

	/// <summary>
	/// 短信验证码总倒计时（秒）
	/// </summary>
	public static int SmsCodeCountdown = 90;
}
